package com.example.dynamic;

import org.springframework.stereotype.Component;

@Component
public class SimpleService {
    
    private String prefix = "Result: ";
    
    public String processData(String input) {
        return prefix + input.toUpperCase();
    }
    
    public int calculate(int a, int b, String operation) {
        switch (operation.toLowerCase()) {
            case "add":
                return a + b;
            case "subtract":
                return a - b;
            case "multiply":
                return a * b;
            case "divide":
                return b != 0 ? a / b : 0;
            default:
                return 0;
        }
    }
    
    public String getInfo() {
        return "SimpleService v1.0 - Dynamic Bean";
    }
    
    @Override
    public String toString() {
        return "SimpleService[dynamic]";
    }
}